Matrix Spreadsheet
version 2.0
Wednesday, 23 February 2000
screen shot of Matrix

Instruction Manual

Welcome to Matrix
Matrix is a free DOS spreadsheet program which can be downloaded from
http://members.xoom.com/finnegam/

See the 'readme.txt' file in the archive for last minute information not included in this manual.

The minimum requirements to run Matrix are:

A PC with at least 2 megabytes of memory and MS-DOS 6 or Windows 95/98
A Math co-processor. All 486s and Pentium microprocessors have a build-in math co-processor, but some 386s may have a co-processor as a separate chip.
A mouse.


Features of Matrix:

Full mouse control, including easy range selection.
Pull-down menus
Variable column widths, including the option of hiding columns by giving them a zero width.
Grid of 26 columns by 100 rows minimum, or 26 by 800 rows maximum
Printer support and redirecting output to a text file for further editing in a text editor or word processor.
Built-in clipboard with cut, copy and paste with formula replication across rows and columns.
Customise all the colour elements to your liking, such as scrollbar, sheet area, menu bar, status line etc. You can have alternative rows coloured in different colours to make it easier to see which row you're on. Instead of the default LIGHTGRAY and CYAN you can choose any other combination for every second row. Or you can turn off the effect altogether by giving both rows the same colour.
Over 40 functions covering trigonometric, scientific, financial, logic, date and string handling purposes.


How to enter a Matrix Function
A Matrix function is always identified by the @ symbol preceding the function's name. The function's name can be in either small case or capital letters or any combination of both.

The function's arguments, written in parentheses, specify the cell or cells on which the function will act. For example, the following function, which we will assume lies in cell B21, computes the total of a range of eight cells from B12 to B19:

    B21 = @SUM(B12:B19)

Notice that the syntax of the range is according the Microsoft spreadsheet format i.e., B12:B19. If you are used to representing a range of cells in the Lotus 1-2-3 format this may cause you to make a few typing errors until you get used to it.

Two ways to input a formula
There are two ways of entering a formula. If you want to overwrite the current formula just move the cell's cursor to the desired cell and start typing away. This is known as direct mode. But if you have made a typing error when entering a complex formula you don't need to go to all the bother of retyping the formula in again. Just press the F2 key to enter edit mode and the input line at the bottom of the screen will display the cells current contents and allow you to edit them. You can use the cursor keys to move back through the formula to the part that needs to be corrected. To exit without making any changes press the ESC key, or if you want to have the changes accepted press either the cursor up or down keys or press RETURN.

When in either direct mode or edit mode you can move the cell's cursor up or down with the cursor keys. Only in direct mode can you also move to the cell on the right by pressing the cursor right key -- when in edit mode the cursor right key will not take you to the next cell, but to the next character position in the input line. Direct mode is for experienced spreadsheet user who want to prepare a sheet quickly and to be able to exit fast from the input line and go on to the cell either above, below or to the right of the current cell in just one key press. If you are new to spreadsheets its best to get used to pressing the F2 key to enter edit mode, then any mistakes can be easily edited.

The @ symbol
All functions are prefixed with the @ symbol. The @ symbol tells the expression parser that the entry is a function. For example @SUM is the name of a function, and the statement (B12:B19) is the argument (in this case, a range). This function tells Matrix to compute the sum of the numbers located in cells B12, B13, B14, B15, B16, B17, B18, and B19 and display the result in cell B21.

The syntax of the functions
A few functions, like @TODAY do not take an argument. These functions are discussed in detail later. The syntax of a function that takes no argument is like this: @TODAY()

Some functions can be quite complex. For example, several functions can be combined in a single cell by having one function use other functions as its arguments. The length of an argument, however, is limited; like formulas, functions can contain a maximum of 126 characters per cell. If the formula needs to exceed this limit you should break it up and put the partial results in separate cells then use another formula in another cell to join the partial results together. A separate area of the sheet can be set aside for partial results. The formula in cells containing the partial results can be hidden. If you don't want your partial results to be seen there are two ways to hide the cells: either give the formulas in the cells the same foreground colour as the background colour or hide the column of cells altogether by giving it a zero width. An example of this can be seen in the calendar.mtx sheet. Unlock all the cells to see the formulas in them, then choose the option from the Cols/Rows menu to reveal all the hidden columns of cells. This lets you see how the sheet was originally designed before its appearance was tidied up.

Variable Sheet Colours
The colour dialogue box allows you to select various highlight colours if you want to colour different areas of the sheet. First choose the colour for the highlight as if you were selecting a paintbrush colour. Then select the range of cells to be highlighted, then choose "colour cells" in the Rows/Cols menu to apply that colour to the selected range. To colour other cells in a different colour simply repeat the procedure.

Hiding and revealing columns

If you accidentally hide a column while in the process of narrowing its width using the mouse on the column header, you can get the column back again, because an extra item has been added to the "Cols/Rows" menu to reveal all the hidden columns.

Hidden columns can be useful for storing information essential to the sheet but which you would prefer not to be displayed. For example, in the calendar sheet there is some data stored in hidden columns to make the calendar work. To see it choose the "reveal cols option".

Formula replication
Formula replication is one of the most powerful features of any good spreadsheet program because it speeds up the creation of tables, and reduces the amount of typing that needs to be done when entering complex formulas.  Formula replication in Matrix works in the standard way common to most spreadsheets. Replication occurs when pasting from the clipboard. If the cell references in the formula are relative they will change when pasted by the relative amount (horizontally or vertically or both, and minus or plus) depending on the relative difference between the original location it came from when you copied it to the clipboard and the new destination you are pasting it to. If as a result of this change a cell reference exceeds the bounds of the spreadsheet array loop-around occurs either from forwards to backwards or from backwards to forwards.

The maximum number of lines Matrix can use will depend on the computer system. If it can only affort to give Matrix 2MBs then the maximum number of lines will be 100, but if there are 16MBs available the maximum number of lines will be 800.

For example: lets assume there is a maximum of only 100 lines. Assume C1 = A99+2. And you then copy it to C2 the formula in C2 will look like this C2 = A100+2. But if you copy it to C3 then the formula in C3 will look like this C3 = A1+2. This is an example of loop-around from forwards to backwards because the spreadsheet bounds have been exceeded -- there is no A101 location. Loop-around also applies to columns as well. But if you "hard-code" the cell references in the formula by prefixing either the column letter or the row number or both with the dollar symbol $ then the cell's reference is declare absolute for either the column or the row or both, which means it will remain unaltered when pasting. The only time when absolute references are altered in the formulas is when you insert or delete a column or a row.

To see a quick demonstration of the power of formula replication load in the file "replicate.mtx". This file only contains a table of movable feast dates for two years: 1975 and 1976, but in just 10 seconds we can build this into a much bigger table covering 46 years from1975 to 2020, and without the need to type in anything. Everything is done using the clipboard, the mouse, and the copy and paste options in the pull-down menu. First select the line for the year 1976 and copy it to the clipboard. The line is from A6 to N6. Then go down to the next line and select the range from A7 to N50. Then go to the paste option or press CTRL and v. The table is filled instantly with new moveable feast dates from 1977 to 2020. The complex formula in the lines have been 'cloned' for the clipboard but only the cell row references in the formulas have changed in relation to the new destination row that each line is copied into.  

 

Auto-Calc and Manual mode
If you are beginning a new spreadsheet it might be a good idea to switch from auto-calculate mode to manual mode. If you do this you will notice a quicker response after each input. Then when the spreadsheet you're working on is ready you can turn on auto-calculate again. It makes little sense to have Matrix waste time after each cell input recalculating the entire sheet when you don't yet need to see how the new formula entry effects all the other cells. If you are using a very fast computer such as a Pentium III 500MHZ (or higher) then the slight delay will not be very noticeable, but if you are using a 486 or even a 386 you will certainly notice a sluggish response after each input if Auto-Calc is switched on. A settings and preferences file called "Grid.ara" is stored in the root of drive C. If you delete this the default settings will be used next time you run Matrix.

Printing the Spreadsheet
Matrix has printer support. But if you want to redirect output to a file to edit it later in a word processor or text editor then this is possible. First go to the "Settings" option and change the name from "LPT1" to any other name. Include a suffix such as ".txt" then click ok. Then when you go to the print option Matrix will write a text file of that name to the current directory path. If you are not sure where the file has been written just look at the path that appears in the open dialogue box. If you only want to print or write out some of the sheet then select the area first before printing it.

Improving the appearance of the spreadsheet

When you want to change the display properties of more than one cell at a time, such as the alignment or the number of decimal places or whether numbers are to appear in commas or not, first select the range then choose the desired option from the format menu. The same also applies when locking or unlocking cells.

Adjusting the speed of a double-click
Not all people double-click at the same speed. The reflexes of one user might be a whole lot faster then those of another. The double-click time rate refers to timing based on the build-in system clock, which means, regardless of the processor speed, the recorded duration should be much the same. The recommended range of values is from 38 to 44. By increasing the double -click value in the settings box you can get a better response if you are a bit slow double-clicking.

Which File is loaded?
You can see the title of the currently loaded file by clicking on the status line and hold the mouse button down. When you release it the previous normal status contents reappears.


What is the time?
Time seems to fly when you're working away at a computer. If you are engrossed for some time on a spreadsheet and you haven't got a watch on you you can see the current time in the about box.

 

Mathematical Functions
Matrix contains 32 functions that perform mathematical, logarithmic, and trigonometric operations. These functions are built-in mathematical formulas that perform tasks which would take much longer or could not be done at all with the mathematical operators alone, such as *, /, +, or - or %

The percentage symbol
If you enter a number like 5% it will be interpreted as 0.05, but it may be displayed as 5.00%. To display it as just 5% you need to go to the format menu and set the number of digits after the decimal point to zero. All formulas containing a % at the end will cause the cell to be displayed as a percentage. If later you enter just 5 it will still be display as 500% because the cell's percentage display property was previously switched on. In this case you need to toggle the percentage display off, by choosing the percent option in the format menu.

General Mathematical Functions
At least a few of the six functions that perform general mathematical operations will be useful to almost everyone who works with Matrix. These functions are summarised in table

Table 1
General Mathematical Functions

Function Description
@ABS( number or cell reference) Computes absolute value
@INT(number or cell reference) Computes the integer portion of a specified number
@ROUND(number or cell reference, number)   Rounds numbers to a specified precision
@SQRT(number or cell reference)  Computes the square root
@RAND() Generates random numbers

 

@ABS--Computing Absolute Value
The @ABS function computes the absolute value of a number. Use this function when you need to convert a value from negative to positive or when you want to be absolutely sure that the result is always positive. For example the @EASTER function returns a negative date if Easter occurs in March, and a positive date if it occurs in April. The form of the function is

   @ABS(number or cell reference)



@INT--Computing the Integer

The @INT function computes the integer portion of a number by eliminating all digits to the right of the decimal point. The form of this function is

  @INT(number or cell reference)

Using the @INT function is not the same as formatting the cell to display zero decimal places. @INT differs from a zero decimal point format in two ways: (1) formatting changes the display, but continues to store the value to its full precision; computations based on the cell containing the value will use the full value. @INT on the other hand, actually eliminates the decimal portion of the number and stores only the integer portion. (2) The formatted display shows rounded numbers; @INT does not round, but simply eliminates the decimal portion. With @INT, 4.99999 is changed to 4, not 5.


@ROUND--Rounding Numbers

The @ROUND function is used to round numbers to a specified precision between negative 9 and positive 9. @Round help you avoid potential problems caused by Matrix's floating-point arithmetic. The general form of the @Round function is

  @ROUND(number or cell reference, number)

The first argument is the number to be rounded. The second argument specifies the number of decimal places. It should be between 0 and 9

@ROUND differs both from a formatting change and from the @INT function. Formatting changes simply change the way values are displayed, not the way they are stored. @INT changes the way values are displayed and how they are stored, but does not round the values. @ROUND changes the way values are displayed and how there're stored, but, instead of just deleting the decimal part of the value (as @INT does), rounds the numbers to a specified precision.

 

@SQRT--Finding the Square Root
The @SQRT function computes the square root of a positive number. The form of the function is

  @SQRT(number or cell reference)

@SQRT is a simple but useful function with few restrictions. If you try to take the square root of a negative number or of a number divided by zero, the function returns an ERROR. Results are accurate to 15 decimal places, but this version of Matrix can only display 9 digits after the decimal point, but to see them you may need to adjust the column width and the formatted of  the decimal places.

 

@RAND--Generating Random Numbers
The @RAND built-in function generates pseudo-random numbers between 0 and 1. Cells containing the @RAND function display a different value between 0 and 1 each time the spreadsheet is recalculated.

Trigonometric Functions

Matrix also has a set of trigonometric functions. If you normally use the program only for financial calculations you probably will never need these functions. Trigonometric functions will be invaluable, however, if you are developing engineering or scientific applications Table 2 Summarises the trigonometric functions available in Matrix.

Table 2
Trigonometric Functions

Function Description
@PI()                         Computes the value of the constant pi
@SIN(number or cell reference) Computes the sine
@COS(number or cell reference)  Computes the cosine
@TAN(number or cell reference) Computes the tangent
@ACOS(number or cell reference)        Computes the arcosine


@PI--Computing Pi
The @PI function simply computes the value of pi, accurate to 15 decimal places, or 3.141592653589794. @PI is one of the functions that take no arguments. The form of PI is
  @PI()

Remember that whenever @PI is used in the spreadsheet, the full 15-place value is returned, even though the column width or formatted number of decimal places may be too small to display the entire value.

@PI is useful in a variety of trigonometric equations, such as converting the degrees of an angle to radians. To compute the radians of an angle use the formula:
   
  Radians = @PI() * Degrees / 180

 

@SIN, @COS, and @TAN-Computing
Trigonometric Functions

The @SIN, @COS, and @TAN functions calculate the sine, cosine, and tangent, respectively, of an angle in radians. These functions take the following form:
  @SIN(angle in radians or cell reference)

  @COS( angle in radians or cell reference)

  @TAN(angle in radians or cell reference)

If you know the degrees of an angle, you can compute the radians by using this formula:

  Radians = PI() * Degrees/180

Logarithmic Functions
Matrix provides three logarithmic functions primarily for use in engineering, scientific, and other complex equations. Table 3 lists the logarithmic functions with descriptions of their use.

Table 3
Logarithmic Functions

Function Description
@LOG(number or cell reference) Computes the (base 10) logarithm
@EXP(number or cell reference) Computes the value of the constant e raise to a specified power
@LN(number or cell reference)        Computes the natural logarithm


@LOG--Computing Logarithms
As its name implies, the @LOG function calculates the logarithm(base 10) of a positive number. The form of the function is

  @LOG(number or cell reference)

If the argument of the @LOG function is a negative value or zero, an error will be returned


@EXP--Finding Powers of e
The @EXP function calculates the value of the constant e raised to a power specified by the argument, where e equals approximately 2.7182818. The form of @EXP is

  @EXP(number or cell references)



@LN--Computing Natural Logarithms
The @LN function calculates the natural logarithm (base e) of the argument. The form of @LN is
  @LN(number or cell reference)

The value of the argument must be a positive number; otherwise, the function will calculate an error and display ERROR in the cell.


Statistical Functions
Matrix contains a set of functions that can perform simple statistical analyses. These functions are used typically with an argument consisting of a range of cells. A range is a rectangular block of one or more cells. The syntax is like this A1:A12

Table 4 summarises the statistical functions available in Matrix

Table 4
Statistical Functions

Function        Calculates
@AVG(range)        Average of nonblank cell in the range
@COUNT(range)        Number of nonblank entries in the range
@MAX(range)        Maximum value in the range
@MIN(range)     Minimum value in the range
@SUM(range)       Total of values in the range
@VAR(range) Population variance of values in the range
@STD(range)      Population standard deviation of values in the range


Basic Statistical Functions

Matrix's simpler statistical functions are @SUM, @MAX, @MIN, @COUNT, and @AVG. The most basic of these (@SUM) has many uses outside as well as within a statistical context. @SUM is frequently used in spreadsheets and you will undoubtedly find it useful in many applications. The other basic statistical functions are used less widely but are still handy tools.

@SUM--Calculating Sums
@SUM(range) computes the sum of a range of entries. The range is typically a partial row or a column, but a range can also be a block defined by cell co-ordinates. For example, in a simple worksheet the function @SUM(A1:A2) returns the value 110, or 345 + 765.

One advantage of the @SUM function (and other range functions as well) is that @SUM is more adaptable than a formula to changes made in the spreadsheet with cut-and-paste commands. For example, the function @SUM(A1:C1) is equivalent to the formula A1+B1+C1

@MAX and @MIN--Computing Maximum
and Minimum Values

The @MAX and @MIN functions return the maximum and minimum values in a range. As with the @SUM function, the range can be a partial row or column, a block of several partial rows and columns.


@COUNT--Counting Entries in a Range
The @COUNT function is similar to the @MAX, @MIN, and @SUM functions. @COUNT returns the count of the number of nonblank entries in a range. The cells in the range can contain either text or numbers or formulas.


@AVG--Computing the Average (Mean)
The final function in this group is @AVG. This function computes the mean, or average, of all the numeric cells in the range.

The @AVG function does not returns the same value as the @SUM function divided by the @COUNT if any cells within the rage contain text. @AVG only looks at numeric cells in a range, whereas @COUNT counts at all nonblank cells in a range. @AVG return the average of all the numeric cells in the range but ignores nonblank cells and cells containing text.

 

Advanced Statistical Functions
Although you are probably familiar with statistics if you are interested in using advanced statistical functions, we will provide a brief review here as a foundation for the explanation of Matrix's functions.

One basic statistic is the mean, often called the arithmetic average, which is commonly used to mark the average of a group of data values. The mean is calculated by adding the values and dividing the sum by the number of values. The mean is not to be confused with the median or mode, which are also measures of central tendency. The median is the value midway between the highest and lowest value in the group, in terms of probability. Half of the values in the group are above the median, and half are below it. The mode is the most probable value in a group of items (that is, the value that occurs most often).

Variance and standard deviation are related dispersion statistics. The variance is the amount of deviation from the mean. The standard deviation, closely related to the variance, is the degree of deviation from the mean, or the square root of the Variance.

To calculate the variance, you subtract the mean of the numbers from each number in the group and square each result. You then add the squares and divide the total by the number of items in the group. To compute the standard deviation, you take the square root of the variance.

Matrix has two functions that automatically perform these calculations for you. These advanced statistical functions are

@VAR(list)       Computes the population variance
@STD(list)       Computes the standard deviation of a population

An example of these two function is contained in the example file var.mtx

Referring to this example file what does the standard deviation tell you? As a general rule, about 67 percent of the items in a normally distributed population will fall within a range that is plus or minus one standard deviation of the mean. In the example, that means that roughly 67 per cent of the salesmen sold between 77 and 125 items. About 95 percent of the items in a normally distributed population fall within plus or minus two standard deviations of the mean.

To make further use of the statistical functions, you should know the difference between population and sample statistics. Population statistics are used when you know the value of all the items in a population. But when the number of items is large and you don't know them all (which is usually the case), you are unable to compute the population statistics. Instead, you must rely on sample statistics as estimates of the population statistics.

In the sales example, if we realistically assume that we had only a small portion of the entire population of sales figures, we can compute the sample statistics. This is even more realistic if we examine only one month's sales out of the total population of all the monthly sales for a year. When we move into the realm of sample statistics, we start dealing with much more sophisticated statistical concepts.

To calculate the sample variance for the previous sales data, you multiply the population variance by n/n-1 (degrees of freedom), where n equals the number of items in the sample. The degrees of freedom tell you how much freedom you have in calculating a variance.

We use the @COUNT function to determine the degree of freedom:
Degree of freedom = @COUNT(list)/ (@COUNT(list)-1)*@VAR(list)

To compute the standard deviation of the sample, we take the square root of the sample variance. A convenient way to do this is to use the @SQRT function:
Sample Standard Deviation = @SQRT(Sample Variance) =
@SQRT(@COUNT(list)/(@COUNT(list)-1)*VAR(list))

Because standard deviation is the square root of the variance, we can also compute the sample standard deviation using the following formula:
Sample Standard Deviation = @SQRT(degrees of freedom)@STD(list) =
@SQRT(@COUNT(list)/ (@COUNT(list) -1))*@STD(list)

Analysing Investments and
Calculating Depreciation

Matrix has 11 financial functions that perform a variety of investment calculations, and three functions that calculate book depreciation. The basic financial functions, @NPV and @IRR, calculate the return on an investment; @PV, @FV, and @PMTC perform loan and annuity calculations. @EFF and @NOM for converting from effective interest rate to the nominal rate and vise versa. The @RATE, @TERM, and @CTERM functions perform compound-growth calculations. The @IRATE function finds the nominal rate at which the outstanding balance of a loan is compounded per period, (usually every month). The last three functions @SLN, @DDB, and @SYD calculate depreciation by three commonly used methods. Table 5 reviews the financial functions available in Matrix

Table 5
Financial Functions

Investment Functions         Calculates
@NPV(int, range)       Net Present value of an investment and a series of periodic cash flows
@IRR(guess, range)    Internal rate-of-return of a series of periodic cash flows
@PV(pmt, int, term)      
Present value of a series of equal cash flows
@FV(pmt, int, term)   Future value of a series of equal payments
@PMTC(prin, int, term, x12)    Periodic payment amount
@EFF(nominal rate, x12) Convert to the Effective Interest rate
@NOM(effective rate, x12) Convert to the nominal Interest rate
@RATE(fv, pv, term)    Return on an investment
@IRATE(prin, term, x12, pmt) Return nominal annual interest rate a loan is charged at.
@TERM(pmt, int, fv)   Number of payment periods of an investment
@CTERM(int, fv, pv)    Number of compounding periods an investment must grow for a desired return

 

Depreciation Functions  Calculates
@DDB(cost, salvage, life, period)         Double-declining-balance depreciation
@SYD(cost, salvage, life, period)         Sum-of-the-years' digits depreciation
@SLN(cost, salvage, life) Straight-line depreciation


Definition of terms

int = periodic interest rate cost = cost of asset
prin = principal amount salvage = asset salvage value
pv = present value life = asset life
fv   = future value period = specific year
term = number of periods x12 = number of compounding
periods per year


@NPV--Net Present Value
The @NPV function computes the net present value of a stream of cash flows. The form of this function is

  @NPV(Discount Rate, Range)

Discount Rate is the interest rate that Matrix uses to compute the net present value. Range is the stream of cash flows to be discounted. The interval between the cash flows must be constant and must agree with the period of the discount rate. For example, an annual discount rate should be used for cash flows occurring a years apart. If the cash flows occur every month, a monthly rate should be used (divide the annual discount rate by 12).

The @NPV function can be used to evaluate a variety of investment opportunities. For example, suppose that you had an opportunity to invest in a share of real estate which would create the following cash flows over the next five years:
    End of Yr    Cash flow
    1    (2,000)
    2    1,000
    3    1,500
    4    1,500
    5    1,500
You can create a simple worksheet to evaluate this investment, as illustrate in the example file "npv.mtx". The function @NPV(B1, C7:G7) returns 2202.63, the net present value of that stream at a discount rate of 9 percent if the investment is made at the end of year 1. The function @NPV(B1, D9:G9)+C9 returns a value of 2400.86 at a discount rate of 9 percent if the investment is made at the beginning of year 1.

If 9 percent represents the rate you need on the investment, and could earn on other investments with a similar degree of risk, and the NPV of the investment is greater than or equal to ú2,000, you can conclude that the real estate share probably offers a good investment opportunity. Note that the difference in the two calculated NPVs shows that the timing of the investment is important; you can earn an extra ú198.23 if you made the investment at the beginning of year 1.

We use a cell reference, B1, to enter the discount rate into the function. Because it would be just as easy to enter the formula @NPV(.09, D9:G9), you might wonder why we took the approach we did. In fact, there is no advantage to using either method until you decide to change the rate.

For example, assuming that in the example file "npv.mtx" you wanted to evaluate the investment using a rate of 14 percent. With the method we used, all you need to do is enter the number .14 or 14% into cell B1 and recalculate the sheet. If the rate had been embedded in the formula, we would have to edit the cell, replace the .09 with .014, close the cell, and then recalculate. If several changes were required, this operation would waste valuable time. Using a cell reference, however, we can quickly update the analysis as interest rates change or new investment opportunities arise.

@IRR--Internal Rate of Return
Internal rate of return (IRR) is the discount rate that equates the present value of expected cash outflows with the present value of expected inflows. In simpler terms, IRR is the rate of return, or percentage of profit, that an investment is expected to earn. Like net present value, internal rate of return determines the attractiveness of an investment opportunity.

The @IRR function is built on an iterative process in which you provide an initial estimated discount rate (anything between 0 and 1 will do); Matrix then calculates the actual discount rate, calculating the Net Present Value of the series of cash outflows and in flows using your estimated interest rate. On each iteration it compare the result with 0.0. If the result is below 0 it decreases you estimated interest rate and tries again. If the result is above 0 it increases the estimated interest rate and tries again. The amount by which the interest rate is increased or decreased is roughly half the previous rate. It keeps going through this iteration process until either it has looped 1,000 times, in which case an error is returned, or until it has reached an estimated interest rate that when applied to the NPV function result in 0.0 (give or take a tiny fraction.) The interest rate that achieved a Net Present Value of 0.0 for those cash outflows and inflows is then returned as the Internal Rate of Return. It is the interest rate that determines how profitable the investment is.

You may encounter some problems with the @IRR function. As indicated earlier, Matrix may not converge on a value based on your initial estimate. Either the stream of cash flows does not have an internal rate of return, or your initial estimate is too far from the actual internal rate of return for Matrix to converge within 1000 iterations.

An extreme example of the stream of cash flows without an internal rate of return is a stream of all outflows without no inflows. Without income to cover the expenditures, no interest rate will yield a net present value of 0, and @IRR will return an error message.

If you get an error message or an unreasonable value from the @IRR function, try different initial estimates and then double-check the result.

@PV--Present Value
The @PV function is used to calculate the present value of an ordinary annuity for a given number of periods and interest rate. An ordinary annuity is a series of payments made at the end of equally spaced intervals, and present value is the value today of the payments to be made or received later, discounted at a given interest or discount rate.

Calculating the present value of an ordinary annuity gives you a way to compare different investment opportunities or potential obligations while taking into account the time value of money.

The general form of the @PV function is
  @PV(payment, interest, term)

You can use the @PV function in a formula to calculate the present value of an annuity due, or annuity in arrears. That formula is
Present Value of
An Annuity Due = @PV(payment, interest, term)*(1+interest)

Like an ordinary annuity, an annuity due is a series of payments, but made at the beginning of equally spaced time intervals. The example sheet "pv.mxt" shows the results of calculating the present value of an ordinary annuity and an annuity due.

The difference between @NPV, the function for net present value, and @PV stems from the difference in cash flows and how the cash flow values are arranged in the spreadsheet. @NPV calculates the net present value of a series of flows that may or may not be equal, but that are all contained in a range of cells in the spreadsheet. The cash flows in the @PV function must all be equal, and the amount of the flows must be contained in a single cell or entered as a value in the @PV function. Remember to use the @NPV function to calculate the present value of a stream of unequal cash flows.

@FV--Future Value
The @FV function is similar in form to the @PV function, but is used to calculate the future value of an ordinary annuity. Future value is the value at a given day in the future of a series of payments or receipts, compounded at a given interest or discount rate. Calculating the future value of an ordinary annuity allows you to compare different investment alternatives or potential obligations. The @FV function looks like this:
  @FV(payment, interest, term)

You can calculate the future value of an annuity due with a formula similar to the one that calculates present value of an annuity due. The formula is
  Future Value of
  An Annuity Due = @FV(payment, interest, term)*(1+interest)

The example file "fv.mxt" shows the results of calculating the future value of an ordinary annuity and an annuity due.


@PMTC--Calculating loan Payment Amounts
The @PMTC function calculates the payment required for a given principal, interest rate, and number of periods. This function is used to calculate mortgage or loan repayments. The format of the @PMTC function with n equalling the number of periods is
@PMTC(principal, interest, n, 12)

If the number of compounding periods is less than 12, for example every two months, then change the 12 to 6. The principal is the initial amount borrowed. The interest is the nominal or flat rate. Example 13.772% is entered as either 13.772% or 0.13772.

To give an example: suppose you wish to borrow ú4,667 for 4 years, repaying in monthly instalments, with the outstanding loan balance of the loan compounded monthly at a flat rate of 13.772% annually then the figures you would enter are:
@PMTC(4667, 13.772%, 48, 12)
The result returned is rounded to the nearest penny. In this example it is ú127


@Eff--Find the effective Interest rate
The @Eff function converts from the nominal rate to the Effective rate. For example if a Credit Union charges a nominal rate of 1% compounded monthly on a loan then the true rate would be approximately 12.68%.

The format of the @Eff function is
  @Eff(nominal rate, x12)

x12 is the number of times the nominal rate is compounded per year. If it is compounded every quarter x12 would be 3, if every two months it would be 6, if every 6 months it would be 2.    

@Nom--Find the nominal Interest rate
The @Nom function converts from the effective rate to the nominal rate. For example if a Credit Union charges a nominal rate of 1% compounded monthly on a loan then the nominal annual rate would be 12%, and the effective rate approximately 12.68%.

The format of the @Nom function is
  @Nom(effective rate, x12)

x12 is the number of times the nominal rate is compounded per year. If it is compounded every quarter x12 would be 3, if every two months it would be 6, if every 6 months it would be 2.    


@RATE--Compound Growth Rate

The @RATE function calculates the periodic interest rate necessary for an investment (
present-value) to grow to a future-value over the number of compounding periods in term.
The format of this function, where n equals the number of periods, is
  @RATE( future value, present value, n)

For example, suppose you invested $10,000 in a bond that matures in five years and has a maturity value of $18,000. Interest is compounded monthly. You want to determine the periodic interest rate for this investment.
@RATE(18000,10000,60) returns 0.984%, the periodic (monthly) interest rate. To determine the annual interest rate, use the formula ((1+@RATE(18000,10000,60))^12)-1. This yields an annual interest rate of 12.47%.

The @FV function's basic formula calculates the future value of an initial investment given the interest rate and the number of periods. For the @RATE calculation, the formula is rearranged to compute the interest rate in terms of the initial investment, the future value,and the number of periods.
Interest Rate = (future value/ present value)^(1/n) -1

As another example, you could use the @RATE function to determine the yield of a zero-coupon bond that is sold at a discount of its face value. Suppose that for ú350 you can purchase a zero-coupon bond with a ú1,000 face value maturing in 10 years. What is the implied annual interest rate? The answer is show in the file "rate.mtx".

The @RATE function is also useful in forecasting compound growth rate between current and projected future revenues, earnings, and so on.

 

@IRATE--Finds the nominal interest rate of a loan.

The @IRATE function is useful when you want to find the nominal interest rate the outstanding balance of a loan is charged at per year.

The format of the function is

  @IRATE(principal, term, x12, pmt)

where principal is the amount you wish to borrow; term is the total number payments over the life of the loan; x12 is the number of compounding periods per year. This is usually 12, but if the loan balance was being compounded every two months, x12 would be 6. Pmt is the periodic payment.

To clarify all of this, suppose you wish to borrow ú4667 to buy a second-hand car. To replay the loan with interest over 4 years you agreed to pay 48 monthly payments of ú127. You want to find the annual nominal interest the lender is charging. The parameters your would enter are:

  @IRATE(4667, 48, 12, 127)  

To give another example. Suppose you are resident in Ireland and you want to borrow ú999 to buy a Fujitsu Pentium III 6000mhz computer system from the ESB.  You agree to make 18 payments over three years, one payment every two months, with your regular electricty bill. Each payment is ú69.63. You want to find the nominal rate of the loan and the APR rate. (In Ireland and Britain APR, Annual Percentage Rate, refers to the Effective Interest Rate, but the Americans use the term to refer to the nominal interest rate. This leads to some confusion. However, in this example we will assume APR refers to the Effective Interest Rate, because that's what it refers to in the ESB's advertisements.)

The formula you enter looks like this:

  =@EFF(@IRATE(999.00, 18, 6, 69.63), 6)

And the result returned is 16% or 0.16. This is the effective annual interest rate of the loan.

 

@TERM -- Term of an Investment
The @TERM function calculates the number of periods required to accumulate a specified future value by making equal payments into an interest bearing account at the end of each period. The form of the @TERM function is
@TERM(payment, interest, future value)

The @Term function is similar to the @FV function except that instead of finding the future value of a stream of payments over a specified period, the @TERM function finds the number of periods required to reach the given future value.

Suppose you want to determine the number of months required to accumulate ú5,000 by making a monthly payment of ú50 into an account paying 6 percent annual interest compounded monthly (.5 percent per month). The example file "term.mtx" shows how @TERM can help you get the answer, which is slightly more than 81 months (6 years and 9 months) for an ordinary annuity, but slightly less than 81 months for an annuity due. For this account, making the deposit at the beginning of the month makes only a little difference.

To calculate the TERM for an annuity due, use the equation
  TERM for
  Annuity Due = @TERM(payment, interest, future value)/(1+interest)

@CTERM--Compound Term of an Investment
The @CTERM function calculates the number of periods required for an initial investment earning a specified interest rate to grow to a specified future value. Whereas @TERM calculates the number of periods needed for a series of payments to grow to a future value at a specified interest rate, the @CTERM function specifies the present value, the future value, and the interest rate, and finds the required number of periods. The form of the @CTERM function is
  @CTERM( interest, future value, present value)

The @CTERM function is useful for determining the term of an investment necessary to achieve a specific future value. For example, suppose that you want to determine how many years it will take for ú2,00 invested in an Interest bearing account at 10 percent interest to grow to ú10,000. The example file "cterm.mtx" shows how to use the @CTERM function to determine the answer, which is just over 16 years and 10 months.

@SLN-Straight --Line Depreciation
The SLN function calculates straight-line depreciation given the asset's cost, salvage value, and depreciable life. The form of the function is
@SLN(cost, salvage value, life)

The formula used to calculate @SLN is
SLN = (cost - salvage value) / life

The @SLN function conveniently calculates straight-line depreciation for an asset. For example, suppose that you have purchased a machine for ú1,000 that has a useful life of three years and a salvage value estimated to be 10 percent of the purchased price (ú100) at the end of its useful life. The example file "ddb.mtx" shows how to use @SLN function to determine the straight-line depreciation for the machine, ú300 per year.

 

@DDB-Double--Declining-Balance Depreciation
The @DDB function calculates depreciation using the double-declining balance method, with depreciation ceasing when the book value reaches the salvage value. Double-declining-balance depreciation is a method of accelerating depreciation so that greater depreciation expense occurs in the earlier periods rather than the later ones. Book value in any period is the purchase price less the total depreciation in all prior periods.

The form of the @DDB function is
  @DDB(cost, salvage value, life, period)

In general, the double-declining-balance depreciation in any period is
Book value * 2/n

The book value is the book value in the period, and n is the depreciable life of the asset. Matrix, however, like Lotus 1-2-3, adjusts the results of this formula in later periods in to ensure that total depreciation does not exceed the purchase price less the salvage value.

The example file "ddb.mtx" shows how the @DDB function can calculate depreciation on an asset purchased for ú1,000, with a depreciable life of three years and an estimated salvage value of ú100. The example file also shows a comparison of the results of the @DDB and the @SLN functions.

Keep in mind when you use the double-declining-balance depreciation method for an asset worth a small salvage value, the asset will not be fully depreciated in the final year. If this is the case with one of your assets, you'll need to calculate the remaining depreciation for the one additional year. For example, if the asset in the example file has a salvage value of ú10 rather than ú100, you can use the formula
(C2-C3)-@SUM(D13:F13) in cell G13 to calculate the remaining depreciation

@SYD-Sum-of-the-Years'-Digits Depreciation
The @SYD function calculates depreciation by the sum-of-the-years'-digits method. This method also accelerates depreciation so that the earlier life of the item reflects greater depreciation than later periods.

The form of the function is
  @SYD(cost, salvage value, life, period)

in which the cost is the of the purchase cost of the asset, the salvage value is the estimated value of the asset at the end of the depreciable life, life is the depreciable life of the asset, and period is the period for which depreciation is to be computed.

@SYD calculates depreciation with the following formula:

((cost - salvage value)* ( life period +1)) / (life*(life+1)/2)

The expression life period+1 in the numerator shows the life of the depreciation in the first period, decreased by 1 in each subsequent period. This reflects the declining pattern of depreciation over time. The expression in the denominator, life*(life+1)/2, is equal to the sum of the digits 1+2 + … + life. This is the origin of the name sum-of-the-years'-digits.

The example file "ddb.mtx" shows how the @SYD function can calculate depreciation for an asset costing ú1,000 with a depreciable life of three years and an estimated salvage value of ú100

Data Management Functions
Matrix has a 1 simple data management function: @CHOOSE

@CHOOSE-Selecting an Entry from a List
The @CHOOSE function acts like a subscript into a variable array. It allows you to select the contents of any cell with in a range based on the index value you supply.

The format of the @CHOOSE function is
  @CHOOSE(index, range)

The index value must be greater than 0 and either equal to or less than the number of cells in the range. For example to choose the 2nd cell in the range B2, C6 the syntax is:
@CHOOSE(2, B2, C6)

(Notice the range syntax in this function uses the comma instead of the colon.)

The contents of cell C2 are returned because the range is 2 columns by 5 rows. If you wanted to choose cell B3 the index value would need to be 3. The formula to determine the location the index value refers to is
Column reference is mod(index , (x2 - x1)+1)+x1
The row reference is INT(index / ((x2-x1)+1))+y1
Where x1, x2 are the column boundaries of the range, and y1 is the top row in the range.

The example files "moveable_feasts.mtx" and "calendar.mtx" show how to use this function. Unlock the cells to see the formulas.


@IF-Creating Conditional Tests
The @IF function allows you to test one or more conditions in your spreadsheet and perform appropriate tasks based on the outcome of the test. You could, for example, have a worksheet that functions as a job-application data-entry form that you want to make sensitive to the age of the applicant. You could construct a formula using the @IF function that would made certain automatic cells display if the age is less than 21, and other automatic displays if the age is greater than or equal to 21.

The basic form of the @IF function is
  @IF(condition, vtrue, vfalse)

where the first argument (condition) is tested for true or false. If the result of the test is true (1), the function will return the value of vtrue. If the condition is false (0) the function will return the vfalse value. The condition itself must be numeric, but the answer returned, either vtrue and vfalse, can be either blank string , a string with something in it or numeric value.

@Rand--Pseudo Random number generator
Generates a value between 0 and 1
syntax: @RAND()

 

@TYPE - Indicate the Type of the cell
The @TYPE function indicates the type of the cell. It return a -1 if the cell contains an error; 0 if the cell is empty, 1 if the cell contains text, or 2 if it contains either a number or a formula that evaluates to a number. The form of the @TYPE function is:
@TERM(cell reference)

The example file "Calendar.mtx" shows how to use this function.

 

Date Functions
There are 4 functions that deal with dates.
@Easter, @GETDATE, @BIGDAYS, @TODAY. An explanation of Each of these functions follows.

@EASTER - Indicate the date of Easter Sunday for any Year
The @EASTER function indicates the month and the date within that month that Easter Sunday falls on for any given year. The form of the @EASTER function is:
@EASTER(cell reference or number)

The @EASTER function is given the year whose date you want to find out. For example: @EASTER(2000) will return 23. But @EASTER(1997) will return -30. Easter occurs on the Sunday following the first full moon after the 21 March.
A negative date is return if its in March, or a positive date if its in April.

The files "Calendar.mtx" and "Moveable_feasts.mtx" give examples of how to use this function.

@GETDATE - Indicate the Month and the date of a day number of any Year
This function returns a number which contains coded information concerning the month and the date within that month a given day number between 1 and 365 (or 366 in a leap year) is placed in the calendar for a given year. By itself this function is not much use, but when used with the other date functions it can act as a helper, thereby greatly simplifying the creation of spreadsheets that use dates, such as calendars. The information is decoded like this.
A1 = @GETDATE(2000, 33)

Month = @Int(A1/ 32)
Date = @MOD(A1, 32)

The files "Calendar.mtx" and "moveable_feasts.mtx" contain examples of this function.

@BIGDAYS -- Convert a Date into a Serial Number
The format of this function is:
@BIGDAYS( date, month, year)
where year is any year from the start of the Gregorian calendar (in 1582) to 2100. Month is any month from 1 to 12, and date is any date within that month. For example:

  @BIGDAYS(1, 9, 1939)

will return 708083. In order to prevent making a mistake when entering dates notice the date is entered according to the British notation, with the date number coming before the number of the month. For example. The date 1/9/1939 reads the 1st of September 1939 to us British/Irish, but to the Americans it reads January 9th, 1939. When entering dates just remember that the British/Irish notation is used. If you are a programmer you could delve into the source code and change the function so that it would accept dates represented in the American format.

This function by itself is not much use, but when used with the other date functions, it can come in very handy. For example, suppose you number the days of the week from 0 to 6, with Sunday representing 0, and Saturday representing 6, then in order to figure out what day the 1st of September 1939 fell on all you have to do is use the @MOD function with the BIGDAYS function like this:

  day of week = @MOD(@BIGDAYS(1, 9, 1939), 7)

The result is 5. This means the 1st of September 1939 occurred on a Friday, and two days later on Sunday the 3rd at 11:15am, Neville Chamberlain, the British Prime Minister, announced over BBC radio that Britain had declared war on Germany.

@TODAY - Convert today's Date into a Serial Number
Another handy use from the previous function is when you want to find out how many days old you are. The @TODAY function returns a serial number which can be used for this purpose.

Days past = @TODAY() - BIGDAYS(6, 4, 1975)
The result returned is 9076 but this figure will be incremented by one each day. In this example Today is 10 February, 2000. Therefore we just subtract the serial version of today from the serial version of the date in the past and the result is the number of days that have elapsed. This function can be useful for those interested in biorhythmic cycles.

String handling functions
The string functions Matrix supports are @STR, @STRCMP, @STRCAT, and @STRCAT1


@STR(13.6, 2,1)--Convert a number to a string.
The first parameter is the number, the second parameter is the number of
decimal places, the third parameter is 1 if you want the number in
commas, or 0 if not.


@STRCAT(a1, a2)--Joins two strings together with a space between them.

This function joins two string together but it places a space between them. For example:
  @STRCAT('James', 'Bond')
return the string "James Bond". But if you want to join strings without placing a
space between them use the next function.

@STRCAT1(a1, a2)--Joins two strings together without a space between them.
This function joins two string together but does not place a space between them. For example:
  @STRCAT1('James', 'Bond')
return the string "JamesBond".

@STRCMP(a1, a2)--Compare two strings
This function compares two strings against each other. If string A1 is equal to string A2 the function return 0, if A1 is smaller the function returns -1, else it return 1.


List of Functions Matrix version 1.5 supports

1 ABS 16 STR 31 MIN
2 ACOS 17 STRCAT 32 MAX
3 IF 18 STRCMP 33 AVG
4 PMTC 19 BIGDAYS 34 DDB
5 SUM 20 TODAY 35 SLN
6 CHOOSE 21 EASTER 36 SYD
7 IRATE 22 GETDATE 37 SQRT
8 TYPE 23 INT 38 VAR
9 EFF 24 NPV 39 STD
10 COS 25 IRR 40 RATE
11 SIN 26 PV 41 ROUND
12 TAN 27 FV 42 RAND
13 LN 28 TERM 43 STRCAT1
14 LOG 29 CTERM 44 PI
15 EXP 30 COUNT 45 MOD
46 NOM


Associating ".mtx" files with Matrix.
If you want Matrix to start up automatically when you click on a Matrix data file from the desktop or in a folder then you need to associate files of type ".mtx" with the Matrix.exe. Go to the run dialogue box and enter winfile.exe. File manager will start up. Then under the "File" menu scroll down until you come to the sub-menu option "Associate..." and select it. Enter .mtx in the "Files with extension" box, then click on the "browse" button and locate the path where matrix was stored. You may find it at
c:\windows\temp\matrix1.matrix.exe
if not try the path
c:\windows\desktop\matrix\matrix.exe

When you find it click on it File manager will associate files ending in ".mtx" with Matrix. What happens is that an entry like this is written into the win.ini file (located in the c:\windows directory ) under the "extensions" heading:
MTX=C:\windows\temp\matrix1\matrix.exe ^.MTX


⌐ Michael Finnegan
Grove Business Software
Dingle, Co. Kerry, Ireland